<?php
/** 
 * @EventListener(onEvent="XLoggingEvent")
 */
if(!interface_exists('XEventListener', false)){
	require_once(XFRAMEWORK_DIR.'/core/event/XEventListener.php');
}
class XLogListener implements XEventListener{
	public function onEvent(XEvent $event){
		if($event instanceof XLoggingEvent){
			return $this->log($event);
		}
	}
		
	protected function log(XLoggingEvent $event){
		$logger = XLog::singleton()->logger();
		if($logger){
			$logger->log($event);
		}
		return true;
	}
}
?>